/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javaseapp - LoTest
 * <p>Powered by webrx On 2021-08-09 15:43:17
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class LoTest {
    public static void main(String[] args) {
        ADC ez = new ADC("伊泽瑞尔", 700, 76);
        ez.adAttack();
    }
}

//英雄类
class Hero {
    //共有属性
    String name;
    int hp;

    public Hero() {
        this.name = "无名";
        this.hp = 1000;
    }

    public Hero(String name, int hp) {
        this.name = name;
        this.hp = hp;
    }

    //共有方法
    public void goHome() {
        System.out.println(this.name + "还有" + this.hp + "血量，回城补状态");
    }
}

//ADC类继承英雄类
class ADC extends Hero {
    //特有属性
    private int adPower;

    public ADC(String name, int hp, int adPower) {
        super(name, hp);
        this.adPower = adPower;
    }

    //特有方法
    public void adAttack() {
        System.out.println("我是ADC" + this.name + ",自带攻击力" + adPower);
        super.goHome();
    }
}

